/**
 * 远程控制 - api
 * @author xiaoxujs
 */

import { basicIp, newHttpService } from "../../../api/http";
import { IYckzZyLoadControlAddLoadParams, IYckzZyLoadControlBarrierConfigStatusUpdateParams, IYckzZyLoadControlBarrierConfigUpdateParams, IYckzZyLoadControlCatchParamSetParams, IYckzZyLoadControlLiveParamSetParams, IYckzZyLoadControlMaterialNameUpdateParams, IYckzZyLoadControlModeStatusUpdateParams, IYckzZyLoadControlModeUpdateParams, IYckzZyLoadControlPlcOffsetUpdateParams, IYckzZyLoadControlPlcParamSetParams, IYckzZyLoadControlScreenParamSetParams, IYckzZyLoadControlScreenStatusUpdateParams, IYckzZyLoadControlTitleUpdateParams, IYckzZyLoadControlUpdateLoadParams, IYckzZyLoadControlVideoParamSetParams } from "../../../type/remoteControl/loadingControlList";

// 添加装车站
export const postYckzZyLoadControlAddLoad = (data: IYckzZyLoadControlAddLoadParams) => {
    const url = basicIp + '/yckz/zy-load-control/addLoad';
    return newHttpService.postData(url, data)
}
// 装车站列表
export const getYckzZyLoadControlWareHouseList = () => {
    const url = basicIp + '/yckz/zy-load-control/wareHouseList';
    return newHttpService.getData(url);
}
// 装车站 投入或停止使用
export const getYckzZyLoadControlIsNotUse = (data: {
    id: string
}) => {
    const url = basicIp + '/yckz/zy-load-control/isNotUse';
    return newHttpService.getData(url, data)
}
/**
 * 删除装车站   
 * @param data 装车站id
 */
export const getYckzZyLoadControlDeleteLoad = (data: {
    id: string
}) => {
    const url = basicIp + '/yckz/zy-load-control/deleteLoad';
    return newHttpService.getData(url, data)
}
/**
 * 装车站 - 参数设置 - 详情
 * @param data 装车站id/yckz/zy-load-control/paramSet
 */
export const getYckzZyLoadControlParamSet = (data: {
    id: string
}) => {
    const url = basicIp + '/yckz/zy-load-control/paramSet';
    return newHttpService.getData(url, data)
}

/**
 * 编辑装车站基本信息
 * @param data 编辑装车站入参
 */

export const postYckzZyLoadControlUpdateLoad = (data: IYckzZyLoadControlUpdateLoadParams) => {
    const url = basicIp + '/yckz/zy-load-control/updateLoad';
    return newHttpService.postData(url, data)
}
/**
 * 编辑装车站PLC
 * @param data 编辑装车站PLC入参
 */

export const postYckzZyLoadControlPlcParamSet = (data: IYckzZyLoadControlPlcParamSetParams) => {
    const url = basicIp + '/yckz/zy-load-control/plcParamSet';
    return newHttpService.postData(url, data)
}
/**
 * 编辑抓拍相机
 * @param data 编辑装车站抓拍相机入参
 */

export const postYckzZyLoadControlCatchParamSet = (data: IYckzZyLoadControlCatchParamSetParams) => {
    const url = basicIp + '/yckz/zy-load-control/catchParamSet';
    return newHttpService.postData(url, data)
}
/**
 * 装车站 - 编辑直播参数
 * @param data 编辑装车站直播参数入参
 */

export const postYckzZyLoadControlLiveParamSet = (data: IYckzZyLoadControlLiveParamSetParams) => {
    const url = basicIp + '/yckz/zy-load-control/liveParamSet';
    return newHttpService.postData(url, data)
}
/**
 * 装车站 - 编辑物料参数
 * @param data 编辑装车站物料参数入参
 */

export const getYckzZyLoadControlMaterialNameUpdate = (data: IYckzZyLoadControlMaterialNameUpdateParams) => {
    const url = basicIp + '/yckz/zy-load-control/materialNameUpdate';
    return newHttpService.getData(url, data)
}
/**
 * 装车站 - 编辑PLC偏移量参数
 * @param data 编辑装车站PLC偏移量参数入参
 */

export const postYckzZyLoadControlPlcOffsetUpdate = (data: IYckzZyLoadControlPlcOffsetUpdateParams) => {
    const url = basicIp + '/yckz/zy-load-control/plcOffsetUpdate';
    return newHttpService.postData(url, data)
}
/**
 * 装车站 - 编辑视频回放参数
 * @param data 编辑视频回放参数入参
 */

export const postYckzZyLoadControlVideoParamSet = (data: IYckzZyLoadControlVideoParamSetParams) => {
    const url = basicIp + '/yckz/zy-load-control/videoParamSet';
    return newHttpService.postData(url, data)
}
/**
 * 装车站 - 编辑道闸出入口参数
 * @param data 编辑道闸出入口参数入参
 */

export const postYckzZyLoadControlBarrierConfigUpdate = (data: IYckzZyLoadControlBarrierConfigUpdateParams) => {
    const url = basicIp + '/yckz/zy-load-control/barrierConfigUpdate';
    return newHttpService.postData(url, data)
}
/**
 * 装车站 - 编辑屏幕参数
 * @param data 编辑屏幕参数入参
 */

export const postYckzZyLoadControlScreenParamSet = (data: IYckzZyLoadControlScreenParamSetParams) => {
    const url = basicIp + '/yckz/zy-load-control/screenParamSet';
    return newHttpService.postData(url, data)
}

/**
 * 装车站 - 编辑模式设置参数
 * @param data 编辑模式设置参数入参
 */

export const postYckzZyLoadControlModeUpdate = (data: IYckzZyLoadControlModeUpdateParams) => {
    const url = basicIp + '/yckz/zy-load-control/modeUpdate';
    return newHttpService.postData(url, data)
}
/**
 * 装车站 - 编辑大屏幕标题设置参数
 * @param data 编辑大屏幕标题设置参数入参
 */

export const postYckzZyLoadControlTitleUpdate = (data: IYckzZyLoadControlTitleUpdateParams) => {
    const url = basicIp + '/yckz/zy-load-control/titleUpdate';
    return newHttpService.getData(url, data)
}

//  抓拍图片
export const getYckzZyLoadControlCatchPicture = (data: { catchId: string }) => {
    const url = basicIp + '/yckz/zy-load-control/catchPicture';
    return newHttpService.getData(url, data)
}

// 模式状态设置
export const getYckzZyLoadControlModeStatusUpdate = (data: IYckzZyLoadControlModeStatusUpdateParams) => {
    const url = basicIp + '/yckz/zy-load-control/modeStatusUpdate';
    return newHttpService.getData(url, data)
}
// 显示屏状态设置
export const getYckzZyLoadControlScreenStatusUpdate = (data: IYckzZyLoadControlScreenStatusUpdateParams) => {
    const url = basicIp + '/yckz/zy-load-control/screenStatusUpdate';
    return newHttpService.getData(url, data)
}
// 闸道状态设置状态设置
export const getYckzZyLoadControlBarrierConfigStatusUpdate = (data: IYckzZyLoadControlBarrierConfigStatusUpdateParams) => {
    const url = basicIp + '/yckz/zy-load-control/barrierConfigStatusUpdate';
    return newHttpService.getData(url, data)
}


// 获取装车流程是否开启
export const getKshGetLsIsStart = () => {
    return newHttpService.getData(basicIp + '/ksh/getLsIsStart');
}
// 开启/关闭装车流程

export const getKshLsStop = (data: { type: 0 | 1 }) => {
    return newHttpService.getData(basicIp + '/ksh/lsStop', data)
}
// 获取给料机设置
export interface IYckzZyLoadControlHetGlj {
    controlId: string// 给料机id
    glj1: string// 给料机1名称
    glj1Num: string// 给料机1编号
    glj2: string// 给料机2名称
    glj2Num: string // 给料机2编号
}
export const getYckzZyLoadControlHetGlj = (data: {id: string}) => {
    const url = basicIp + '/yckz/zy-load-control/getGlj';
    return newHttpService.getData(url, data);
}
// 设置给料机参数
export interface IYckzyZLoadControlSetGljParams extends IYckzZyLoadControlHetGlj {
    controlId: string// 给料机id
}
export const postYckzyZLoadControlSetGlj = (data: IYckzyZLoadControlSetGljParams) => {
    const url = basicIp + '/yckz/zy-load-control/setGlj';
    return newHttpService.postData(url, data)
}


